package com.woniu.stafforder.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 此接口为客服用户通讯接口
 */
@RestController
@Api(value = "CallController",tags = "可以获取客服缓存池中的客户和客服信息,实现点击拨通")
public class CallController {
    @Autowired
    private StringRedisTemplate redisTemplate;
    @GetMapping("/getUserList")
    public Map queryUserCacheList(){
        Map<Object, Object> yongHu = redisTemplate.opsForHash().entries("YongHu");
        if (yongHu!=null){
            return yongHu;
        }
        return new HashMap();
    }
    @GetMapping("/getKeFuList")
    public Map queryKeFuCacheList(){
        Map<Object, Object> keFu = redisTemplate.opsForHash().entries("KeFu");
        if (keFu!=null){
            return keFu;
        }
        return new HashMap();
    }
}